package com.tushare.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tushare.entity.TimeShareChart;
import com.tushare.mapper.TimeShareChartMapper;
import com.tushare.service.ITimeShareChartService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-03-08
 */
@Service
public class TimeShareChartServiceImpl extends ServiceImpl<TimeShareChartMapper, TimeShareChart> implements ITimeShareChartService {

    @Override
    public List<TimeShareChart> getTimeShareChartListByTsCode(String ts_code) {
        return getBaseMapper().getTimeShareChartListByTsCode(ts_code);
    }

    @Override
    public boolean saveOrUpdateBatch(List<TimeShareChart> list) {
        if (list == null) {
            return false;
        }
        if (list.size() == 0) {
            return true;
        }
        return getBaseMapper().saveOrUpdateBatch(list);
    }

    @Override
    public boolean deleteTimeShareChartByTsCode(String ts_code) {
        return getBaseMapper().deleteTimeShareChartByTsCode(ts_code);
    }
}
